#include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;

template <typename T, typename = enable_if_t<is_arithmetic<T>::value>>
void Count(vector<T> records)
{
	unordered_map<T, int> mymap;
	for (auto record : records)
	{
		mymap[record]++;
		cout << mymap[record] << " ";
	}
	cout << endl;
}

int main()
{
	vector<unsigned short> records;
	
	unsigned short num;
	cout << "请输入记录条数：";
	cin >> num;

	cout << "请输入记录的读者编号：" << endl;
	while (num--)
	{
		unsigned short tmp;
		cin >> tmp;
		records.push_back(tmp);
	}

	Count(records);

	return 0;
}
